package week2.practical;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import java.util.Date;

public class ButtonV2Activity extends Activity implements View.OnClickListener {
	Button btn1;
	Button btn2;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		btn1=(Button)findViewById(R.id.button1);
		btn1.setOnClickListener(this);
		btn2=(Button)findViewById(R.id.button2);
		btn2.setOnClickListener(this);
	}

	@Override
	public void onClick(View view) {
		updateTime();
	}

	private void updateTime() {
		btn1.setText(new Date().toString());
		btn2.setText("Clicked");
	}
}
